<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box{
            width:50px;
            height:200px;
            background:pink;
            position:fixed;
            right:30px;
            top:50%;
            margin-top:-100px;
        }

        .box a{
            background:url(images/kefu.jpg);
            display:block;
            height:50px;
            width:50px;
            color:#fff;
        }
        .box a:nth-child(2){
            background-position-y:-50px;
        }
        .box a:nth-child(3){
            background-position-y:-100px;
        }
        .box a:nth-child(4){
            background-position-y:-150px;
        }
        .box a:hover{
            background-position-x:-50px;
        }
        .box span{
            width:0;
            height:50px;
            line-height:50px;
            position:absolute;
            left:0px;
            background:#007af9;
            text-align: center;
            overflow: hidden;
            transition:all 0.5s;
        }
    </style>
</head>
<body>
    <div class="box">
        <a href="">
            <span>在线客服</span>
        </a>
        <a href="">
            <span>028-1565654</span>
        </a>
        <a href="">
            <span>工单系统</span>
        </a>
        <a href="">
            <span>返回顶部</span>
        </a>
    </div>
    <script>
        var btn=document.querySelectorAll('.box a');
        btn.forEach(function(v,i){
            v.onmouseover=function(){
                this.children[0].style.width='150px';
                this.children[0].style.left='-150px';
            }
            v.onmouseout=function(){
                this.children[0].style.width='0';
                this.children[0].style.left='0';
            }
        });
    </script>
</body>
</html>